package dao.jpa;

import java.util.List;

import vo.Element;
import vo.Template;
import dao.TemplateDAO;

public class TemplateDAOJpaImpl extends GenericDaoJpaImpl<Template, Long> implements TemplateDAO {

	public TemplateDAOJpaImpl() {
		super(Template.class);
	}

	public List<Template> findAll() {
		return super.executeFinder("Template.findAll");
	}

	public long findTotalCount() {
		return super.executeFinderCount("Template.findTotalCount");
	}

	public long findTotalCount(long sourceId) {
		return super.executeFinderCount("Template.findTotalCountBySourceId",sourceId);
	}

	public List<Template> findBySourceId(long sourceId) {
		return super.executeFinder("Template.findBySourceId", sourceId);
	}

	public List<Template> findBySourceId(int start, int pageSize, long sourceId) {
		return super.executeFinderPage("Template.findBySourceId", start, pageSize, sourceId);
	}

	public Template getById(long id) {
		return super.read(id);
	}

	public void update(long id) {
		Template e = super.read(id);
		super.update(e);
	}

	public void delete(long id)// 真正删除
	{
		Template e = super.read(id);
		super.delete(e);
	}

}
